package 设计模式.创建型.单例模式.一处理资源冲突问题打印日志的程序.最初实现;

import java.io.IOException;

public class UserController {
    private Logger logger = new Logger();

    public UserController() throws IOException {
    }

    public void login(String username, String password) throws IOException {
        // ...省略业务逻辑代码...
        logger.log(username + " logined!");
    }
}